約 4,742,131 件
https://w.atwiki.jp/socup/pages/234.html
UICollectionViewLayoutをサブクラスでカスタマイズすると様々なレイアウトでセルを並べられる。 参考 実装UICollectionViewLayoutAttributesプロパティ 参照 クラスメソッド 用語 主要メソッド layoutAttributesForElementsInRect 参考 http //blog.kjapps.com/2012/11/06/uicollectionviewlayout/ 実装 まず必要な実装 collectionViewContentSize スクロール領域のサイズ、大体UICollectionViewのサイズ layoutAttributesForElementsInRect UICollectionViewLayoutAttributesのArray layoutAttributesForItemAtIndexPath UICollectionViewLayoutAttributesのArray layoutAttributesForSupplementaryViewOfKind atIndexPath layoutAttributesForDecorationViewOfKind atIndexPath shouldInvalidateLayoutForBoundsChange UICollectionViewLayoutAttributes プロパティ frame center size transform3D alpha zIndex hidden 参照 indexPath representedElementCategory あなたはこの値を使う事ができる。区別するために。 その区別とはレイアウト属性が一つのセルがsupplementary Viewかdecoration Viewかであるか。 typedef enum { UICollectionElementCategoryCell, UICollectionElementCategorySupplementaryView, UICollectionElementCategoryDecorationView } UICollectionElementCategory; reperesentedElementKind あなたはこの値を使うことができる。特定の属性と関連した supplementary かdecoration view の特定の 効果を同定するためにである。 もしthe representedElementCategory propertyにUICollectionElementCategoryCellがはいっていたら この値はnilとなっている。 クラスメソッド +layoutAttributesForCellWithIndexPath +layoutAttributesForDecorationViewOfKind withIndexPath + layoutAttributesForSupplementaryViewOfKind withIndexPath 用語 +supplementary view ヘッダ、フッタのような使い方のview DecorationView 見た目の装飾用 主要メソッド invalidateLayout 更新 prepareLayout レイアウト処理時に呼ばれる layoutAttributesForElementsInRect 領域内にあるView達のUICollectionViewLayoutAttributes の配列を返す。 Cell,DecorationView,SupplementaryViewに応じて クラスメソッド layoutAttributesFor***を使い分けること。
https://w.atwiki.jp/nothing/pages/446.html
アスランは腹の上で手を組んで、天井を見上げた。 プレスの前で問題発言をした後、コーチのイザークがさっさと行くぞと声を掛けにきた。これ以上、相手を刺激して欲しくないのだろうと険しい表情を見て気づく。 『貴様、何を考えている。牽制のつもりか?』 『そんなつもりはないけれど、まあ、そんな所』 『だとしたら失敗だな。お前の弟の方がダメージを食らっているぞ』 よろよろと出て行くように見えたシン。 『あちゃー』 『この考えなしがぁ!』 案の定、シンの部屋を訪れてみればなにやら一人沈んでいる様子。アスランは予想通りの結果に苦笑して天井のライトからシンへと再び視線を移した。 「お前、自分のスケート好きか?」 トンボが目玉を食らった顔でシンはポカンと口を開けていた。 「俺はスケートが好きだし、ジャンプばかり注目されるのが面白くないと思っている。けど、お前もそうなのか?」 多分に二重を否定を含んでいる。 けれど、お前は違うだろ? そんなニュアンス。 緊張していた顔の筋肉が緩んで、シンは「そうだ」と言いたかった。けれど声にならずに、下から覗き込む兄を見つめることしかできない。口で言ってできるほど簡単な事ではない。 そんなことはない。 ジャンプだって楽しいじゃないか、と。 ガサゴソと動いて身体を起こしたアスランがシンの頭に手を置く。そうしてしまえば、シンはまた見上げる羽目になって、どう言ったらいいのか言葉に詰まる。ぐちゃぐちゃと髪をかき混ぜられて、目を瞑った。 「俺だって、ジャンプを否定する気はないよ」 「でも兄貴・・・くるくる飛んで回るだけだって言ったじゃないか」 「スケートはさ、滑る、飛ぶ、回るの3つで成り立ってるよな。どれか一つでも欠けたら面白くないだろ、バランスの問題だよ」 「どれを得意にするかは人それぞれだろ。お前の得意とするものはなんだ?」 えっと。俺が得意なのは。 「ジャンプ・・・」 「じゃあ落ち込んでる場合か? 目の前でジャンプなんてつまらないって言う選手がいるんだ、お前のやるべき事は何だ?」 「そんな事ないって証明する」 簡単にできないから困っているんじゃないかよ。 「できる、できないは関係ないさ」 「は?」 「誰かに分かってもらいたくて滑るわけじゃないから」 まず自分が楽しむのが先決。自然と楽しさは伝わるから。 そこにスケートの個性は関係ない。 そうだ、目の前の兄貴は自分の為に滑るのだった。 自分が楽しむためにもう一度リンクに立つことを決めたのだった。 しかも、そうするべきだと言ったのは俺じゃないか。 「ったく、オリンピック出場を果たしたとは言え、まだまだ子ど―――んぐ・・・!?」 「うるさい!」 シンは手に合った枕を兄に投げつけてそれ以上続けさせなかった。エルボーのお返しとばかりにラリアットでベッドに沈め、ホールドする。むぐむぐ言う兄は最初こそ手足をばたつかせていたが、シンががっちりホールドしていたので早々に諦めたらしい。ベッドをバンバンと叩く。 「俺だって、超・頑固な兄貴に分かって貰おうなんて思ってません」 叩くのも止めた兄がベッドに沈む。いつもならここで、足蹴りの一つでも飛んでくるところなのに。 選手村のベッドは意外とリッチな作りで、自分の部屋のベッドよりふかふかしていたかも知れない。これが結構寝心地がいいのだ。 「でもまあ、俺の滑りを見て、やっぱりジャンプも捨てたものじゃないなって絶対思うだろうけどね!」 顔を見てやろうと思って邪魔な枕をどかしたら、瞼を閉じた顔があった。 急に静かになっておかしいなと思ったんだ。 「何だよ、そのまま寝るなって自分で言ったくせに」 掛け布団と毛布を持ち上げた所でシンは手を止めた。横から布団を引き抜くと、起こさないように上手いこと中に潜り込んで、自分も一緒に寝ることにしたのだった。 「君の弟、急に動きが良くなってない?」 「そうか?」 フリーの滑る順番を決める時、キラがアスランに話しかけていた。公式練習ではいつものやんちゃぶりが粗相に発展しそうになって、鬼コーチまで見事に復活していた。きっと本国では大きく取り上げられてお茶の間を賑わしたことだろう。 「4回転は飛ぶの?」 「さあ、飛ぶかもな。俺もメダル狙うことにしたから」 「えぇ、ホント!? で、またフリーは曲なしでやるんだ」 良く知っているな。 アスランは顔にそう浮かべてキラを見た。相変わらずの情報収集能力である。 「今度はちゃんと曲をつけるよ。キラも聞いたことあるんじゃないか?」 「僕も知っている曲? なんだろう。あっ、君の番だよ」 抽選の結果、フリーの競技順序が決まった。アスランもシンも同じ第3グループで、第3グループのトップにアスラン、2つ置いてキラ。そして最後がシンと決まった。 フリープログラムは5分。 あらかじめ提出したプログラムと照らし合わせて評価されるポイント制。 冬のオリンピックの花形種目、フィギュアスケートシングルの決勝が行われる頃はもう大会も佳境である。これが終われば女子のシングルが始まり、最後の大詰めを迎える。 フィギュアのスケート会場は熱気に包まれ、第2グループが終わった後のリンクの整備が始まっていた。いよいよ最後のグループである。トップ選手がひしめき、今日この会場に来ている観客の一番お目当て。 「誰のおかげで兄貴のスケートを見られると思ってんだよ。皆、俺に感謝して欲しいよ」 「全くだ」 珍しくコーチと意見が合ってシンは銀髪の鬼コーチを見上げた。 彼もアスランを銀盤に連れ戻した功労者の一人で、共に競い、苦楽を共にしたライバルだった。今、この舞台をどのような心境で見つめているのだろう。ふと、そんな事を思って、青い瞳を覗き込む。 「集中しろ。超えたいと願うなら目を離すな」 リンクの熱気が一転に収束する。 会場に流れる音楽に、シンは息を呑んだ。 「この曲って!?」 「よく許可が降りたものだ」 どよめきはすぐに収まった。 奏でられる管楽器の音色はスカンジナビア大会が始まってから、会場のあちこちで聞こえた曲。 冬季オリンピック、スカンジナビア大会オリンピック・テーマ曲。 ファンファーレで始まる、各競技の表彰式で必ず流れる曲。 誰もがちゃんと聞くのはこれが初めてだろう。 まして、フィギュアの演技で流れるとは誰が予想しただろうか。 耳慣れた曲のファンファーレの最後、アスランはエッジを切って舞い上がった。シンには宙に浮いている時間がやけに長く感じられ、数える間もなくジャンプの回転を見ていた。 1・2・3・・・4回転。ループ。 助走もなくあっさりと飛び上がり、何事もなく着地して滑り出す兄を見て、シンは震えが止まらなかった。 「アスランの奴。本当に負けず嫌いだ。シン・・・」 「えっ、ハイっ!」 俺と同じ4回転ループ。 シンは自分のジャンプと比べていた。 「お前の時代はすぐに来る。乗り越えられない壁じゃない。だから、今は良く見ておくんだ」 高さは兄貴の方があるけど、距離なら俺のほうが飛んでいる。 ストレートラインステップ。レイバックで天井を見たままスピンして滑り出す。両足揃えて飛び、開脚して飛んだ所で、不思議な動きの意味を知った。中継で、録画で、チームの応援で見たことがある。兄の動きは全てこの大会の競技に由来しているのだ。 けれど、それは何も特別な動きじゃない。 滑る、飛ぶ、回る。全てそれらの組み合わせて実現していた。緩急を付けて、時に早く、時に遅く滑る。 クロスカントリー、ラージヒル、モーグル。そこかしこに競技をイメージさせる動き。 ステップではカーリング選手やホッケー選手のように動いて、最後、そうフィギュアスケートが残っている。男子では必須ではないアラベスクで円を描き、伸ばされた長い指の先で時間が止まる。 「あっ」 すっと後ろに足を上げて、そのままエッジの踵を持つ。 ビールマン・スピン。 男子シングルでお目にかかるとは。 拍手は遅れてやって来て、シンの手からドリンクを引っ手繰ってようやく座る。テレビのライトやカメラのフラッシュの前で、アスランは何処を見ているのか分からない。 「兄貴、大丈夫?」 「・・・・・・・・・・・・疲れた」 ボードの前にアスランとシン、そしてイザークが座って結果が出るのを待つ。お茶の間の状況がどうなっているのか想像するだに恐ろしい組み合わせである。 「うわっ、やったぁ!!」 得点が出て、シンはあまりの高得点に思わずアスランに抱きついていた。 スケーティング得点の高さを筆頭に、全てのカテゴリで8点台。一斉にフラッシュが焚かれたのは言うまでもないのだが、すぐにアスランの鉄拳が飛んだ。 「ぐあっ!?」 「こらシン。お前はまだ自分の演技が残っているだろっ!」 オークレーの演技を見守り、ハイネの演技の時にはリンクの手前で準備を始める。イザークとアスランが付いて白いリンクを3人で見ていた。 シンは現在フィギュア界に君臨するキラの演技を固唾を呑んで見守る。 得意のジャンプは絶好調で、唯一人飛ぶことができる4回転アクセルが決まると会場は割れんばかりの拍手で溢れた。 キラのすごいところは、フリーの終盤残り20秒という所で、4回転-3回転のコンビネーションを飛べるところだ。体格はシンと大して変わらないのに、伸びのあるスケーティングはこのリンクが狭く感じられる程。 演技が終わった時の拍手は、アスランの時と同じかそれ以上で。 心臓の高鳴りはSPの時以上だった。 帝王の後に滑るのはシン。とりを飾るのである。 艶やかなスケートも、ダイナミックなスケートも、今はまだシンには届かない。けれど、シンにはシンのスケートがあった。 「お前はお前だ。全力で行けばいい」 「シン。行ってこい」 真っ赤なコスチュームの背中に触れる白い指先。 少し力を込めて押し出され、つっと離れる指先の向こうは、もはや氷の上。シンは白いリンクの上に滑り出た。 戻る 次へ オリンピックのテーマを探しましたが、トリノの曲は見つからず。ロサンゼルス大会のは一杯見つかるのですけど・・・。中間部が結構いい感じの曲だったのだけどな~。次はいよいよ最終回です。一日おいて誤字脱字修正しています。
https://w.atwiki.jp/nothing/pages/426.html
思わぬ形でチャンスが巡ってきたことに、シンとイザークの頭はフル回転した。枠が一つ開いた以上、穴埋めが行われるのは必定。となれば、誰が3人目になるか、だ。 幸いにも、直近の大会でアスランは4位だった。 話題性もある。 プラントのスケート連盟でも割合すんなり話が通ると予想される。 問題は、本人にその気があるかどうか、だった。 「放っておいてもいずればれるし、ネタを嗅ぎつけたメディアが騒ぎ出したら元も子もない」 「何とか、兄貴に『うん』と言わせないと」 これが最後のチャンスになるかも知れないから。 次なんて待っていられない。 シンは到着ロビーの荷物カウンターでアスランが出てくるのを待っていた。さすが開催国だけあって、選手や関係者だけでなく応援団や観光客で空港はごった返していた。 「俺には相応しくない」 シンが思い切って実情を話したのに、アスランはにべもなく突っぱねた。決め付けモードの兄は正直言って厄介である。どう考えてもおかしい言動なのに、自分理論でねじ伏せに来るからだ。そこで下手に食い下がると鉄拳が飛んでくる。 シンは打開策を探して口を噤んでしまったが、イザークは兄の荷物をさりげなく持って歩き出していた。シンとイザークが来た方向へと。 「おい、イザーク! ホテルはそっちの出口じゃない」 「貴様は馬鹿か? せっかくタダで泊まれる場所があるのに、身銭を切るつもりなのか?」 期間中のホテル暮らし料金を考えただけでも恐ろしい。 「早くから予約してたから格安なんだけど」 「どうせ、食事も何も付いていないのだろうーが」 「そうだけど・・・うーん」 決め手にかけて考えあぐねていた兄を見て、シンの頭に選手村のあちこちを巡回していた物体を思い出した。毎日家事をこなしていてる兄が3食自炊ごときで尻込みするわけがない。兄を釣るにはこれしかない。 「すっごく珍しい警備ロボットとかいて安全だし!」 「それは見てみたいかも」 無料バスに乗り込んで選手村へと向かう。シンとイザークはアスランに見つからないようにこっそり笑い合った。昼でも夜のように明かりがつき、オリンピックドームがライトアップされている。 「調子はどうなんだ?」 「まあまあって所」 「まあまあって、明日公式練習じゃないのか?」 あちこちで始まっている予選の熱気が街にも広がっていて、各国の選手団や応援団が街に繰り出している。 「正直、今大会、キラ・ヤマトが頭一つ飛びぬけているのは確かだ。後は2連覇を阻止するために、どれだけ迫れるかって所だ」 「シンはまだまだだとしても、ハイネはいい勝負すると思うけどな」 ハイネはシンと同じフィギュアスケート男子シングルの代表で、アスランの先輩にも当たるベテランである。前回大会にも出場経験を持つ。 「ハイネと連合の若手はいい線行くだろうが・・・」 「なんだイザーク、シンの名前は出ないのか?」 一向にハーラーダービーに顔を覗かせない弟をからかうアスラン。シンは突然自分の名前を出されて、ぎょっとする。気持ちではいつも表彰台の天辺にいるシンも、まさか自分がメダル争いに本気に加われると思っている程浮かれてはいない。 「ダークホースだ。滑りの感じはお前とは違って速さ重視、ある意味、奴と同じスケーティングだが、同じ土俵で勝負できるほどこいつには経験がないからな。4年前のことが無ければ、今最も奴に近い位置にいるのはお前だっただろう」 アスランは窓に肘をつけてイザークの熱心な解説を聞き流していた。通りを行くのは万国博覧会な防寒具。 「どうして、皆して俺を滑らせようとするんだ?」 「そんなの・・・決まってるっ!」 肝心な事を忘れているのだと、シンは自分がスケートを続けている理由を思い出す。スケートは見ているだけでも楽しい、素晴らしい滑りを見れば誰だって滑りたくなる。憧れだった、いつか並びたい、越えたいと思える美しい滑りなら尚更。 それなのに当の本人は中途半端に滑ることを止めてしまったのだ。 まだまだ見ていたい、全然届かない。 「分からないな」 アスランの独り言に、イザークが溜め息を付いた。 選手村のシンの部屋に荷物を運び込んだアスランが荷解きもせずに、シンを置いて部屋を後にした。 カフェテリアを通り過ぎ、コミュケーションセンターを横切る。少し離れたところから4年に1度の祭典の街を喧騒に耳を澄ました。 「どうした、貴様らしくないな」 「・・・イザーク」 両手に湯気の上がるカップを携えたイザークが後ろにいて、片方の手を差し出す。 「相変わらずひどい味だ」 「仕方ないさ、会場内のドリンクは4年前と同じスポンサーだから」 口を付けて、『熱っ』と舌を出すアスラン。 「イザークも俺にまたリンクに立って欲しいと思っているのか?」 「ここまで来て、まだ言うか。この臆病者め」 「ああ。俺は臆病なんだ。問い詰められるのが怖い、滑りきる自信がない、資格の無いものがオリンピックのリンクの上に立って何もないわけがない」 魔物が住むのだ。 銀盤に舞う勝利の女神は、裏を返せば残酷な女神でもある。 「4年前の事故。肩を切って貴様は滑れる状況にはなかった、誰も責めはしない」 予選が終わった後の公式練習で、同じ時間にリンクにいた選手がジャンプで派手に転倒した。転倒したはずみで近くにいた選手にぶつかり、エッジでその選手は大きな怪我を負う。腕を固定して首からぶら下げる程の怪我では棄権するしかなく、4年前の大会はメダル候補が消えて波乱となった。 「でも、イザークはスケートを止めた俺に散々言ったじゃないか」 「当たり前だ。勝ち逃げされたんだからな」 「じゃあ、どうしてコーチになんか、しかもシンの・・・」 氷のように冷たい手すりかと思いきや、熱線が入っているのかイザークが掴んだ手すりはほのかに暖かかった。 「貴様は俺と同じくらい負けず嫌いだ」 同じフィギュアスケートの選手だったシンは、その頃からジュニアの大会でちょくちょく上位に顔を出すようになっていた。まぐれで4回転を飛んだこともあったのだ。 「気の長い話だな、それ」 「だが、目前だ」 「ひどいライバルで、すまない」 歓声が聞こえる。 何かの競技で大技が成功したのだろう。解説者やアナウンサーの興奮気味の声が聞こえてきた。 「ここにいたのかよ、鬼コーチ。あ・・・兄貴」 息を切らせたシンがアスランとイザークを見つけたのは、自国のモーグル選手が金メダルを取ったことをコミュニケーションセンターで知った後だった。紙コップを片手に語り合う兄とコーチにシンは駆け足を急に緩める。 「モーグルで金、取ったって」 「すごい!」 アスランは素直に驚き、その様子を見るためにカフェテリアに戻ろうとシンの横を通り過ぎる。すれ違う時にわざとらしく視線を合わせない兄に、唇をかみ締める。 「逃げるな」 アスランが起こした風が止まる。 「みんな楽しみにしていたんだ。オリンピックは駄目でも怪我が治ったらって」 シンは振り返って背中に叩き付けた。この気持ちをどうしてくれるのだと、胸に手を当てて言う。 「俺だってずっと見ていたかったのに、こんな中途半端なまま宙ぶらりんで取り残されてしまったじゃないかっ!」 アスランは振り返らずに目を閉じる。耳を塞ぐことの代わりとして。 また別の場所で歓声が上がる。あちらこちらで騒ぎ立ち、立ち尽くしたシンとアスランに目を留めるものなどいない。 「どんなに頑張っても、手が届かないんだ。雲を掴むみたいで・・・っ」 「何を言っているんだ。お前の上にはまだ何人もいるだろう。トップスケーターなら4回転なんて飛べて当たり前の時代だ。キラは4回転半を飛ぶんだぞ。俺を追いかけてどうする」 男子のジャンプは今や4回転半へと突入しつつあった。目にも留まらぬ速さで氷の上を回転する選手が纏うのは抵抗の少ない新素材のコスチューム、計算しつくされたエッジには今大会でも新技術が投入される。 少しでも早く回って、遠くへ。 フッと笑ったアスランが、仕方ないなと苦笑してシンを見る。 吐露される本音の外壁。 「それに俺はスケートが楽しく思えなくなっていて、もう限界だったんだ」 「だったらっ」 シンはぎゅっと拳を握りこむ。 ほら、やっぱり、肝心なことに気が付いていない。 皆がそんなのつまらないと思っていると勝手に決め付けているだけで、本当は誰もそんな事を言ってはいないんだ。 少なくとも、アスラン・ザラのスケートをこんなに楽しみにしている奴がここにいるのに。それにコーチだって、きっとそうに決まっているんだ。もしかしたら、今トップにいるあいつだって。 「兄貴は自分が信じるスケートをすればいいじゃないか。何もせずに逃げるのかよ、そんなの俺は認めないっ!」 シンの赤い瞳にアスランの細められた瞳が映りこむ。 搾り出した声は歓声にかき消されてしまったけれど、目の前の兄には届いていた。 「つまらないままでいいのかよ。スケート好きだったんじゃないのかよ!」 アスランの緑の瞳に必死に言葉を紡ぐシンが映る。 周りの喧騒はシンの声が吹き飛ばしていた。 スケートが好き。 最初は見ているだけでよかった。 でも、そのうち自分も滑りたくなって、皆が褒めてくれるからもっと頑張ってみようと思った。突然現れた生き別れの弟と喧嘩ばかりでも、自分が上手に滑ると本当に嬉しそうに自分を見るからもっと上手く滑れるようになりたかった。 でも、何より、自分は氷の上をすいすい滑るのが楽しくて仕方がなかった。 「そうだな。俺のためだ。好きなように滑るのもいいか」 全ての偶然が重なりあって、アスランは再びリンクの上に立つことになった。一回目の公式練習で姿を見せた彼をメディアが取り囲み、彼はあっさりした微笑でそれらを交わした。 リンク中央に浮かび上がるオリンピックの公式ロゴの上でエッジを切る。 数人の選手が決められた時間を練習に費やす中、アスランはリンクの中央で壁際をぐるぐる回るシンを見る。 企みが成功して気が抜けたのか今一やる気が感じられないように見え、文句を言うために一歩踏み出した時だった。 「久しぶり、アスラン」 「・・・キラ」 4年前のライバル同士の再会に、会場のどこかで少しだけフラッシュがたかれた。 「復活の噂は本当だったんだ」 「ああ、成り行きだけどな」 棚ぼたと言えばそうだし、運命と言えばそうだった。 リンクに住む魔物が彼を呼び寄せたのかも知れなかった。 「今回は楽勝だと思ったんだけど、そうは問屋が卸さないか」 「思ってもいないくせによく言う。4年間トップを守り続けてきた自信が透けて見えるぞ」 軽く円を描いて腕を組むアスランと交代して、軌跡の上を寸分変わらずなぞるチャンピオン。対峙する二人を中心にして緊張が膨れる。 「勿論。こうしてリンクの上に立つのなら、ブランクなんて言い訳聞かないから」 ライバル達の思いを踏みにじった4年間。トップを守り続けたキラと、自ら滑ることを止めてしまったイザーク。血の滲むような練習を重ねても、このリンクの上に立てない選手が山といることを知っている。 「分かってるさ」 「・・・でも君の弟君はあまり警戒しなくてもいいみたいだね?」 戻る 次へ ここに来て1回分伸びそうなことに! 書きたいシーンを全部突っ込もうとしていると終わりません。ああ、もっとテンポ良く書けるようになりたい。
https://w.atwiki.jp/nobunyaganoyabou/pages/14.html
/** * Table.js * Functions for interactive Tables * * Copyright (c) 2007 Matt Kruse (javascripttoolbox.com) * Dual licensed under the MIT and GPL licenses. * * @version 0.981 * * @history 0.981 2007-03-19 Added Sort.numeric_comma, additional date parsing formats * @history 0.980 2007-03-18 Release new BETA release pending some testing. Todo Additional docs, examples, plus jQuery plugin. * @history 0.959 2007-03-05 Added more "auto" functionality, couple bug fixes * @history 0.958 2007-02-28 Added auto functionality based on class names * @history 0.957 2007-02-21 Speed increases, more code cleanup, added Auto Sort functionality * @history 0.956 2007-02-16 Cleaned up the code and added Auto Filter functionality. * @history 0.950 2006-11-15 First BETA release. * * @todo Add more date format parsers * @todo Add style classes to colgroup tags after sorting/filtering in case the user wants to highlight the whole column * @todo Correct for colspans in data rows (this may slow it down) * @todo Fix for IE losing form control values after sort? */ /** * Sort Functions */ var Sort = (function(){ var sort = {}; // Default alpha-numeric sort // -------------------------- sort.alphanumeric = function(a,b) { return (a==b)?0 (a b)?-1 1; }; sort[ default ] = sort.alphanumeric; // IE chokes on sort.default // This conversion is generalized to work for either a decimal separator of , or . sort.numeric_converter = function(separator) { return function(val) { if (typeof(val)=="string") { val = parseFloat(val.replace(/^[^\d\.]*([\d., ]+).*/g,"$1").replace(new RegExp("[^\\\d"+separator+"]","g"), ).replace(/,/, . )) || 0; } return val || 0; }; }; // Numeric Sort // ------------ sort.numeric = function(a,b) { return sort.numeric.convert(a)-sort.numeric.convert(b); }; sort.numeric.convert = sort.numeric_converter("."); // Numeric Sort - comma decimal separator // -------------------------------------- sort.numeric_comma = function(a,b) { return sort.numeric_comma.convert(a)-sort.numeric_comma.convert(b); }; sort.numeric_comma.convert = sort.numeric_converter(","); // Case-insensitive Sort // --------------------- sort.ignorecase = function(a,b) { return sort.alphanumeric(sort.ignorecase.convert(a),sort.ignorecase.convert(b)); }; sort.ignorecase.convert = function(val) { if (val==null) { return ""; } return (""+val).toLowerCase(); }; // Currency Sort // ------------- sort.currency = sort.numeric; // Just treat it as numeric! sort.currency_comma = sort.numeric_comma; // Date sort // --------- sort.date = function(a,b) { return sort.numeric(sort.date.convert(a),sort.date.convert(b)); }; // Convert 2-digit years to 4 sort.date.fixYear=function(yr) { yr = +yr; if (yr 50) { yr += 2000; } else if (yr 100) { yr += 1900; } return yr; }; sort.date.formats = [ // YY[YY]-MM-DD { re /(\d{2,4})-(\d{1,2})-(\d{1,2})/ , f function(x){ return (new Date(sort.date.fixYear(x[1]),+x[2],+x[3])).getTime(); } } // MM/DD/YY[YY] or MM-DD-YY[YY] ,{ re /(\d{1,2})[\/-](\d{1,2})[\/-](\d{2,4})/ , f function(x){ return (new Date(sort.date.fixYear(x[3]),+x[1],+x[2])).getTime(); } } // Any catch-all format that new Date() can handle. This is not reliable except for long formats, for example 31 Jan 2000 01 23 45 GMT ,{ re /(.*\d{4}.*\d+ \d+\d+.*)/, f function(x){ var d=new Date(x[1]); if(d){return d.getTime();} } } ]; sort.date.convert = function(val) { var m,v, f = sort.date.formats; for (var i=0,L=f.length; i L; i++) { if (m=val.match(f[i].re)) { v=f[i].f(m); if (typeof(v)!="undefined") { return v; } } } return 9999999999999; // So non-parsed dates will be last, not first }; return sort; })(); /** * The main Table namespace */ var Table = (function(){ /** * Determine if a reference is defined */ function def(o) {return (typeof o!="undefined");}; /** * Determine if an object or class string contains a given class. */ function hasClass(o,name) { return new RegExp("(^|\\s)"+name+"(\\s|$)").test(o.className); }; /** * Add a class to an object */ function addClass(o,name) { var c = o.className || ""; if (def(c) !hasClass(o,name)) { o.className += (c?" " "") + name; } }; /** * Remove a class from an object */ function removeClass(o,name) { var c = o.className || ""; o.className = c.replace(new RegExp("(^|\\s)"+name+"(\\s|$)"),"$1"); }; /** * For classes that match a given substring, return the rest */ function classValue(o,prefix) { var c = o.className; if (c.match(new RegExp("(^|\\s)"+prefix+"([^ ]+)"))) { return RegExp.$2; } return null; }; /** * Return true if an object is hidden. * This uses the "russian doll" technique to unwrap itself to the most efficient * function after the first pass. This avoids repeated feature detection that * would always fall into the same block of code. */ function isHidden(o) { if (window.getComputedStyle) { var cs = window.getComputedStyle; return (isHidden = function(o) { return none ==cs(o,null).getPropertyValue( display ); })(o); } else if (window.currentStyle) { return(isHidden = function(o) { return none ==o.currentStyle[ display ]; })(o); } return (isHidden = function(o) { return none ==o.style[ display ]; })(o); }; /** * Get a parent element by tag name, or the original element if it is of the tag type */ function getParent(o,a,b) { if (o!=null o.nodeName) { if (o.nodeName==a || (b o.nodeName==b)) { return o; } while (o=o.parentNode) { if (o.nodeName (o.nodeName==a || (b o.nodeName==b))) { return o; } } } return null; }; /** * Utility function to copy properties from one object to another */ function copy(o1,o2) { for (var i=2;i arguments.length; i++) { var a = arguments[i]; if (def(o1[a])) { o2[a] = o1[a]; } } } // The table object itself var table = { //Class names used in the code AutoStripeClassName "table-autostripe", StripeClassNamePrefix "table-stripeclass ", AutoSortClassName "table-autosort", AutoSortColumnPrefix "table-autosort ", AutoSortTitle "Click to sort", SortedAscendingClassName "table-sorted-asc", SortedDescendingClassName "table-sorted-desc", SortableClassName "table-sortable", SortableColumnPrefix "table-sortable ", NoSortClassName "table-nosort", AutoFilterClassName "table-autofilter", FilteredClassName "table-filtered", FilterableClassName "table-filterable", FilteredRowcountPrefix "table-filtered-rowcount ", RowcountPrefix "table-rowcount ", FilterAllLabel "Filter All", AutoPageSizePrefix "table-autopage ", AutoPageJumpPrefix "table-page ", PageNumberPrefix "table-page-number ", PageCountPrefix "table-page-count " }; /** * A place to store misc table information, rather than in the table objects themselves */ table.tabledata = {}; /** * Resolve a table given an element reference, and make sure it has a unique ID */ table.uniqueId=1; table.resolve = function(o,args) { if (o!=null o.nodeName o.nodeName!="TABLE") { o = getParent(o,"TABLE"); } if (o==null) { return null; } if (!o.id) { var id = null; do { var id = "TABLE_"+(table.uniqueId++); } while (document.getElementById(id)!=null); o.id = id; } this.tabledata[o.id] = this.tabledata[o.id] || {}; if (args) { copy(args,this.tabledata[o.id],"stripeclass","ignorehiddenrows","useinnertext","sorttype","col","desc","page","pagesize"); } return o; }; /** * Run a function against each cell in a table header or footer, usually * to add or remove css classes based on sorting, filtering, etc. */ table.processTableCells = function(t, type, func, arg) { t = this.resolve(t); if (t==null) { return; } if (type!="TFOOT") { this.processCells(t.tHead, func, arg); } if (type!="THEAD") { this.processCells(t.tFoot, func, arg); } }; /** * Internal method used to process an arbitrary collection of cells. * Referenced by processTableCells. * It s done this way to avoid getElementsByTagName() which would also return nested table cells. */ table.processCells = function(section,func,arg) { if (section!=null) { if (section.rows section.rows.length section.rows.length 0) { var rows = section.rows; for (var j=0,L2=rows.length; j L2; j++) { var row = rows[j]; if (row.cells row.cells.length row.cells.length 0) { var cells = row.cells; for (var k=0,L3=cells.length; k L3; k++) { var cellsK = cells[k]; func.call(this,cellsK,arg); } } } } } }; /** * Get the cellIndex value for a cell. This is only needed because of a Safari * bug that causes cellIndex to exist but always be 0. * Rather than feature-detecting each time it is called, the function will * re-write itself the first time it is called. */ table.getCellIndex = function(td) { var tr = td.parentNode; var cells = tr.cells; if (cells cells.length) { if (cells.length 1 cells[cells.length-1].cellIndex 0) { // Define the new function, overwrite the one we re running now, and then run the new one (this.getCellIndex = function(td) { return td.cellIndex; })(td); } // Safari will always go through this slower block every time. Oh well. for (var i=0,L=cells.length; i L; i++) { if (tr.cells[i]==td) { return i; } } } return 0; }; /** * A map of node names and how to convert them into their "value" for sorting, filtering, etc. * These are put here so it is extensible. */ table.nodeValue = { INPUT function(node) { if (def(node.value) node.type ((node.type!="checkbox" node.type!="radio") || node.checked)) { return node.value; } return ""; }, SELECT function(node) { if (node.selectedIndex =0 node.options) { // Sort select elements by the visible text return node.options[node.selectedIndex].text; } return ""; }, IMG function(node) { return node.name || ""; } }; /** * Get the text value of a cell. Only use innerText if explicitly told to, because * otherwise we want to be able to handle sorting on inputs and other types */ table.getCellValue = function(td,useInnerText) { if (useInnerText def(td.innerText)) { return td.innerText; } if (!td.childNodes) { return ""; } var childNodes=td.childNodes; var ret = ""; for (var i=0,L=childNodes.length; i L; i++) { var node = childNodes[i]; var type = node.nodeType; // In order to get realistic sort results, we need to treat some elements in a special way. // These behaviors are defined in the nodeValue() object, keyed by node name if (type==1) { var nname = node.nodeName; if (this.nodeValue[nname]) { ret += this.nodeValue[nname](node); } else { ret += this.getCellValue(node); } } else if (type==3) { if (def(node.innerText)) { ret += node.innerText; } else if (def(node.nodeValue)) { ret += node.nodeValue; } } } return ret; }; /** * Consider colspan and rowspan values in table header cells to calculate the actual cellIndex * of a given cell. This is necessary because if the first cell in row 0 has a rowspan of 2, * then the first cell in row 1 will have a cellIndex of 0 rather than 1, even though it really * starts in the second column rather than the first. * See http //www.javascripttoolbox.com/temp/table_cellindex.html */ table.tableHeaderIndexes = {}; table.getActualCellIndex = function(tableCellObj) { if (!def(tableCellObj.cellIndex)) { return null; } var tableObj = getParent(tableCellObj,"TABLE"); var cellCoordinates = tableCellObj.parentNode.rowIndex+"-"+this.getCellIndex(tableCellObj); // If it has already been computed, return the answer from the lookup table if (def(this.tableHeaderIndexes[tableObj.id])) { return this.tableHeaderIndexes[tableObj.id][cellCoordinates]; } var matrix = []; this.tableHeaderIndexes[tableObj.id] = {}; var thead = getParent(tableCellObj,"THEAD"); var trs = thead.getElementsByTagName( TR ); // Loop thru every tr and every cell in the tr, building up a 2-d array "grid" that gets // populated with an "x" for each space that a cell takes up. If the first cell is colspan // 2, it will fill in values [0] and [1] in the first array, so that the second cell will // find the first empty cell in the first row (which will be [2]) and know that this is // where it sits, rather than its internal .cellIndex value of [1]. for (var i=0; i trs.length; i++) { var cells = trs[i].cells; for (var j=0; j cells.length; j++) { var c = cells[j]; var rowIndex = c.parentNode.rowIndex; var cellId = rowIndex+"-"+this.getCellIndex(c); var rowSpan = c.rowSpan || 1; var colSpan = c.colSpan || 1; var firstAvailCol; if(!def(matrix[rowIndex])) { matrix[rowIndex] = []; } var m = matrix[rowIndex]; // Find first available column in the first row for (var k=0; k m.length+1; k++) { if (!def(m[k])) { firstAvailCol = k; break; } } this.tableHeaderIndexes[tableObj.id][cellId] = firstAvailCol; for (var k=rowIndex; k rowIndex+rowSpan; k++) { if(!def(matrix[k])) { matrix[k] = []; } var matrixrow = matrix[k]; for (var l=firstAvailCol; l firstAvailCol+colSpan; l++) { matrixrow[l] = "x"; } } } } // Store the map so future lookups are fast. return this.tableHeaderIndexes[tableObj.id][cellCoordinates]; }; /** * Sort all rows in each TBODY (tbodies are sorted independent of each other) */ table.sort = function(o,args) { var t, tdata, sortconvert=null; // Allow for a simple passing of sort type as second parameter if (typeof(args)=="function") { args={sorttype args}; } args = args || {}; // If no col is specified, deduce it from the object sent in if (!def(args.col)) { args.col = this.getActualCellIndex(o) || 0; } // If no sort type is specified, default to the default sort args.sorttype = args.sorttype || Sort[ default ]; // Resolve the table t = this.resolve(o,args); tdata = this.tabledata[t.id]; // If we are sorting on the same column as last time, flip the sort direction if (def(tdata.lastcol) tdata.lastcol==tdata.col def(tdata.lastdesc)) { tdata.desc = !tdata.lastdesc; } else { tdata.desc = !!args.desc; } // Store the last sorted column so clicking again will reverse the sort order tdata.lastcol=tdata.col; tdata.lastdesc=!!tdata.desc; // If a sort conversion function exists, pre-convert cell values and then use a plain alphanumeric sort var sorttype = tdata.sorttype; if (typeof(sorttype.convert)=="function") { sortconvert=tdata.sorttype.convert; sorttype=Sort.alphanumeric; } // Loop through all THEADs and remove sorted class names, then re-add them for the col // that is being sorted this.processTableCells(t,"THEAD", function(cell) { if (hasClass(cell,this.SortableClassName)) { removeClass(cell,this.SortedAscendingClassName); removeClass(cell,this.SortedDescendingClassName); // If the computed colIndex of the cell equals the sorted colIndex, flag it as sorted if (tdata.col==table.getActualCellIndex(cell) (classValue(cell,table.SortableClassName))) { addClass(cell,tdata.desc?this.SortedAscendingClassName this.SortedDescendingClassName); } } } ); // Sort each tbody independently var bodies = t.tBodies; if (bodies==null || bodies.length==0) { return; } // Define a new sort function to be called to consider descending or not var newSortFunc = (tdata.desc)? function(a,b){return sorttype(b[0],a[0]);} function(a,b){return sorttype(a[0],b[0]);}; var useinnertext=!!tdata.useinnertext; var col = tdata.col; for (var i=0,L=bodies.length; i L; i++) { var tb = bodies[i], tbrows = tb.rows, rows = []; // Allow tbodies to request that they not be sorted if(!hasClass(tb,table.NoSortClassName)) { // Create a separate array which will store the converted values and refs to the // actual rows. This is the array that will be sorted. var cRow, cRowIndex=0; if (cRow=tbrows[cRowIndex]){ // Funky loop style because it s considerably faster in IE do { if (rowCells = cRow.cells) { var cellValue = (col rowCells.length)?this.getCellValue(rowCells[col],useinnertext) null; if (sortconvert) cellValue = sortconvert(cellValue); rows[cRowIndex] = [cellValue,tbrows[cRowIndex]]; } } while (cRow=tbrows[++cRowIndex]) } // Do the actual sorting rows.sort(newSortFunc); // Move the rows to the correctly sorted order. Appending an existing DOM object just moves it! cRowIndex=0; var displayedCount=0; var f=[removeClass,addClass]; if (cRow=rows[cRowIndex]){ do { tb.appendChild(cRow[1]); } while (cRow=rows[++cRowIndex]) } } } // If paging is enabled on the table, then we need to re-page because the order of rows has changed! if (tdata.pagesize) { this.page(t); // This will internally do the striping } else { // Re-stripe if a class name was supplied if (tdata.stripeclass) { this.stripe(t,tdata.stripeclass,!!tdata.ignorehiddenrows); } } }; /** * Apply a filter to rows in a table and hide those that do not match. */ table.filter = function(o,filters,args) { var cell; args = args || {}; var t = this.resolve(o,args); var tdata = this.tabledata[t.id]; // If new filters were passed in, apply them to the table s list of filters if (!filters) { // If a null or blank value was sent in for filters then that means reset the table to no filters tdata.filters = null; } else { // Allow for passing a select list in as the filter, since this is common design if (filters.nodeName=="SELECT" filters.type=="select-one" filters.selectedIndex -1) { filters={ filter filters.options[filters.selectedIndex].value }; } // Also allow for a regular input if (filters.nodeName=="INPUT" filters.type=="text") { filters={ filter "/^"+filters.value+"/" }; } // Force filters to be an array if (typeof(filters)=="object" !filters.length) { filters = [filters]; } // Convert regular expression strings to RegExp objects and function strings to function objects for (var i=0,L=filters.length; i L; i++) { var filter = filters[i]; if (typeof(filter.filter)=="string") { // If a filter string is like "/expr/" then turn it into a Regex if (filter.filter.match(/^\/(.*)\/$/)) { filter.filter = new RegExp(RegExp.$1); filter.filter.regex=true; } // If filter string is like "function (x) { ... }" then turn it into a function else if (filter.filter.match(/^function\s*\(([^\)]*)\)\s*\{(.*)}\s*$/)) { filter.filter = Function(RegExp.$1,RegExp.$2); } } // If some non-table object was passed in rather than a col value, resolve it // and assign it s column index to the filter if it doesn t have one. This way, // passing in a cell reference or a select object etc instead of a table object // will automatically set the correct column to filter. if (filter !def(filter.col) (cell=getParent(o,"TD","TH"))) { filter.col = this.getCellIndex(cell); } // Apply the passed-in filters to the existing list of filters for the table, removing those that have a filter of null or "" if ((!filter || !filter.filter) tdata.filters) { delete tdata.filters[filter.col]; } else { tdata.filters = tdata.filters || {}; tdata.filters[filter.col] = filter.filter; } } // If no more filters are left, then make sure to empty out the filters object for (var j in tdata.filters) { var keep = true; } if (!keep) { tdata.filters = null; } } // Everything s been setup, so now scrape the table rows return table.scrape(o); }; /** * "Page" a table by showing only a subset of the rows */ table.page = function(t,page,args) { args = args || {}; if (def(page)) { args.page = page; } return table.scrape(t,args); }; /** * Jump forward or back any number of pages */ table.pageJump = function(t,count,args) { t = this.resolve(t,args); return this.page(t,(table.tabledata[t.id].page||0)+count,args); }; /** * Go to the next page of a paged table */ table.pageNext = function(t,args) { return this.pageJump(t,1,args); }; /** * Go to the previous page of a paged table */ table.pagePrevious = function(t,args) { return this.pageJump(t,-1,args); }; /** * Scrape a table to either hide or show each row based on filters and paging */ table.scrape = function(o,args) { var col,cell,filterList,filterReset=false,filter; var page,pagesize,pagestart,pageend; var unfilteredrows=[],unfilteredrowcount=0,totalrows=0; var t,tdata,row,hideRow; args = args || {}; // Resolve the table object t = this.resolve(o,args); tdata = this.tabledata[t.id]; // Setup for Paging var page = tdata.page; if (def(page)) { // Don t let the page go before the beginning if (page 0) { tdata.page=page=0; } pagesize = tdata.pagesize || 25; // 25=arbitrary default pagestart = page*pagesize+1; pageend = pagestart + pagesize - 1; } // Scrape each row of each tbody var bodies = t.tBodies; if (bodies==null || bodies.length==0) { return; } for (var i=0,L=bodies.length; i L; i++) { var tb = bodies[i]; for (var j=0,L2=tb.rows.length; j L2; j++) { row = tb.rows[j]; hideRow = false; // Test if filters will hide the row if (tdata.filters row.cells) { var cells = row.cells; var cellsLength = cells.length; // Test each filter for (col in tdata.filters) { if (!hideRow) { filter = tdata.filters[col]; if (filter col cellsLength) { var val = this.getCellValue(cells[col]); if (filter.regex val.search) { hideRow=(val.search(filter) 0); } else if (typeof(filter)=="function") { hideRow=!filter(val,cells[col]); } else { hideRow = (val!=filter); } } } } } // Keep track of the total rows scanned and the total runs _not_ filtered out totalrows++; if (!hideRow) { unfilteredrowcount++; if (def(page)) { // Temporarily keep an array of unfiltered rows in case the page we re on goes past // the last page and we need to back up. Don t want to filter again! unfilteredrows.push(row); if (unfilteredrowcount pagestart || unfilteredrowcount pageend) { hideRow = true; } } } row.style.display = hideRow?"none" ""; } } if (def(page)) { // Check to see if filtering has put us past the requested page index. If it has, // then go back to the last page and show it. if (pagestart =unfilteredrowcount) { pagestart = unfilteredrowcount-(unfilteredrowcount%pagesize); tdata.page = page = pagestart/pagesize; for (var i=pagestart,L=unfilteredrows.length; i L; i++) { unfilteredrows[i].style.display=""; } } } // Loop through all THEADs and add/remove filtered class names this.processTableCells(t,"THEAD", function(c) { ((tdata.filters def(tdata.filters[table.getCellIndex(c)]) hasClass(c,table.FilterableClassName))?addClass removeClass)(c,table.FilteredClassName); } ); // Stripe the table if necessary if (tdata.stripeclass) { this.stripe(t); } // Calculate some values to be returned for info and updating purposes var pagecount = Math.floor(unfilteredrowcount/pagesize)+1; if (def(page)) { // Update the page number/total containers if they exist if (tdata.container_number) { tdata.container_number.innerHTML = page+1; } if (tdata.container_count) { tdata.container_count.innerHTML = pagecount; } } // Update the row count containers if they exist if (tdata.container_filtered_count) { tdata.container_filtered_count.innerHTML = unfilteredrowcount; } if (tdata.container_all_count) { tdata.container_all_count.innerHTML = totalrows; } return { data tdata, unfilteredcount unfilteredrowcount, total totalrows, pagecount pagecount, page page, pagesize pagesize }; }; /** * Shade alternate rows, aka Stripe the table. */ table.stripe = function(t,className,args) { args = args || {}; args.stripeclass = className; t = this.resolve(t,args); var tdata = this.tabledata[t.id]; var bodies = t.tBodies; if (bodies==null || bodies.length==0) { return; } className = tdata.stripeclass; // Cache a shorter, quicker reference to either the remove or add class methods var f=[removeClass,addClass]; for (var i=0,L=bodies.length; i L; i++) { var tb = bodies[i], tbrows = tb.rows, cRowIndex=0, cRow, displayedCount=0; if (cRow=tbrows[cRowIndex]){ // The ignorehiddenrows test is pulled out of the loop for a slight speed increase. // Makes a bigger difference in FF than in IE. // In this case, speed always wins over brevity! if (tdata.ignoreHiddenRows) { do { f[displayedCount++%2](cRow,className); } while (cRow=tbrows[++cRowIndex]) } else { do { if (!isHidden(cRow)) { f[displayedCount++%2](cRow,className); } } while (cRow=tbrows[++cRowIndex]) } } } }; /** * Build up a list of unique values in a table column */ table.getUniqueColValues = function(t,col) { var values={}, bodies = this.resolve(t).tBodies; for (var i=0,L=bodies.length; i L; i++) { var tbody = bodies[i]; for (var r=0,L2=tbody.rows.length; r L2; r++) { values[this.getCellValue(tbody.rows[r].cells[col])] = true; } } var valArray = []; for (var val in values) { valArray.push(val); } return valArray.sort(); }; /** * Scan the document on load and add sorting, filtering, paging etc ability automatically * based on existence of class names on the table and cells. */ table.auto = function(args) { var cells = [], tables = document.getElementsByTagName("TABLE"); var val,tdata; if (tables!=null) { for (var i=0,L=tables.length; i L; i++) { var t = table.resolve(tables[i]); tdata = table.tabledata[t.id]; if (val=classValue(t,table.StripeClassNamePrefix)) { tdata.stripeclass=val; } // Do auto-filter if necessary if (hasClass(t,table.AutoFilterClassName)) { table.autofilter(t); } // Do auto-page if necessary if (val = classValue(t,table.AutoPageSizePrefix)) { table.autopage(t,{ pagesize +val}); } // Do auto-sort if necessary if ((val = classValue(t,table.AutoSortColumnPrefix)) || (hasClass(t,table.AutoSortClassName))) { table.autosort(t,{ col (val==null)?null +val}); } // Do auto-stripe if necessary if (tdata.stripeclass hasClass(t,table.AutoStripeClassName)) { table.stripe(t); } } } }; /** * Add sorting functionality to a table header cell */ table.autosort = function(t,args) { t = this.resolve(t,args); var tdata = this.tabledata[t.id]; this.processTableCells(t, "THEAD", function(c) { var type = classValue(c,table.SortableColumnPrefix); if (type!=null) { type = type || "default"; c.title =c.title || table.AutoSortTitle; addClass(c,table.SortableClassName); c.onclick = Function("","Table.sort(this,{ sorttype Sort[ "+type+" ]})"); // If we are going to auto sort on a column, we need to keep track of what kind of sort it will be if (args.col!=null) { if (args.col==table.getActualCellIndex(c)) { tdata.sorttype=Sort[ "+type+" ]; } } } } ); if (args.col!=null) { table.sort(t,args); } }; /** * Add paging functionality to a table */ table.autopage = function(t,args) { t = this.resolve(t,args); var tdata = this.tabledata[t.id]; if (tdata.pagesize) { this.processTableCells(t, "THEAD,TFOOT", function(c) { var type = classValue(c,table.AutoPageJumpPrefix); if (type=="next") { type = 1; } else if (type=="previous") { type = -1; } if (type!=null) { c.onclick = Function("","Table.pageJump(this,"+type+")"); } } ); if (val = classValue(t,table.PageNumberPrefix)) { tdata.container_number = document.getElementById(val); } if (val = classValue(t,table.PageCountPrefix)) { tdata.container_count = document.getElementById(val); } return table.page(t,0,args); } }; /** * A util function to cancel bubbling of clicks on filter dropdowns */ table.cancelBubble = function(e) { e = e || window.event; if (typeof(e.stopPropagation)=="function") { e.stopPropagation(); } if (def(e.cancelBubble)) { e.cancelBubble = true; } }; /** * Auto-filter a table */ table.autofilter = function(t,args) { args = args || {}; t = this.resolve(t,args); var tdata = this.tabledata[t.id],val; table.processTableCells(t, "THEAD", function(cell) { if (hasClass(cell,table.FilterableClassName)) { var cellIndex = table.getCellIndex(cell); var colValues = table.getUniqueColValues(t,cellIndex); if (colValues.length 0) { if (typeof(args.insert)=="function") { func.insert(cell,colValues); } else { var sel = select onchange="Table.filter(this,this)" onclick="Table.cancelBubble(event)" class=" +table.AutoFilterClassName+ " option value="" +table.FilterAllLabel+ /option ; for (var i=0; i colValues.length; i++) { sel += option value=" +colValues[i]+ " +colValues[i]+ /option ; } sel += /select ; cell.innerHTML += " br "+sel; } } } }); if (val = classValue(t,table.FilteredRowcountPrefix)) { tdata.container_filtered_count = document.getElementById(val); } if (val = classValue(t,table.RowcountPrefix)) { tdata.container_all_count = document.getElementById(val); } }; /** * Attach the auto event so it happens on load. * use jQuery s ready() function if available */ if (typeof(jQuery)!="undefined") { jQuery(table.auto); } else if (window.addEventListener) { window.addEventListener( "load", table.auto, false ); } else if (window.attachEvent) { window.attachEvent( "onload", table.auto ); } return table; })();
https://w.atwiki.jp/umamono/pages/12.html
エビソバっていうよりは、、、Restaurant Green View カテゴリー チャイニーズ ロケーション クアラルンプール SS2 日時 2009/3/1 17 30ころ 夕飯時には少し早く着いたにも関わらず、また雨が降る中すでに多くの来客が。かねてからエビソバがうまいと聞いていたんだけれど、本物をみてびっくり。エビと言ってもロブスターのような大きさのエビが真っ二つにひらかれてそばに載っている。そして、そばはそばでも、あんかけのかた焼きそば。見た目の通り、味も抜群。写真は2人前。 #ref error :ご指定のファイルが見つかりません。ファイル名を確認して、再度指定してください。 (Green View Ebisoba.jpg) #ref error :ご指定のファイルが見つかりません。ファイル名を確認して、再度指定してください。 (ファイルのURL)
https://w.atwiki.jp/nothing/pages/1611.html
#blognavi こんなもんじゃろと適当にやったら、教えようとすると結構大変だったでござるよITパスポート。 ストラテジ系 企業活動、法務 経営戦略(経営・技術マネジメント・ビジネスインダストリ) システム戦略(戦略・企画) なんて偉そうな事やる割には、実際どれだけの人がその業務に携われるって言うんですかね。 まず、どんな資格か、シラバス、syllabusとは方針、授業計画、内容って意味から入って4回+テストですからね… 企業活動 企業活動(目的)、経営資源(ヒトモノカネ情報) 経営管理(資源を管理、PDCA) 経営組織(階層型、職能型、事業部、カンパニー、マトリックス、プロジェクト) コンピュータリテラシ(ITを使いこなす能力の教育、他にはOJT、ロールプレイング) 業務分析(OR、IE) 分析イメージ(円・棒・ヒストグラム・パレート、折れ線、回帰分析、散布、レーダー、アロー) 意思決定(フィッシュボーン、シュミレーション、在庫管理) 問題解決手法(ブレーンストーミング、KJ法) 会計(売上、利益、原価、損益分岐点) 財務(BS、PL、CS) 知的財産権(著作権、産業財産権、不正競争防止法) セキュリティ(不正アクセス禁止法、個人情報保護、対策基準アクセス、ウィルス) 労働関連(労基法、労働者派遣法、下請法、PL法) 企業倫理(法令順守、企業統治、情報開示請求) 標準化(バーコード、QR、ISO、IEC、IEEE、W3C、JSA) うむ、30分でこれだけやるのは無理 と、思ったけど、細かい説明をしなければ、30分でいけるな 図とか各種法令の説明は資料見ておいてででも充分だし カテゴリ [つれづれ] - trackback- 2013年02月23日 17 09 09 #blognavi
https://w.atwiki.jp/kojimakk/pages/19.html
Jalview JAVAを用いた配列アラインメントエディター。JAVAを使っているのでプラットフォームに関わらず使用可能。 無料でJalview - Java alignment editor から入手できる。 インストールには、Java version 1.4以上が必要。自分のコンピュータのJavaのversionは ターミナルから java -version で確認できる。 ダウンロードページで Start with Java Web Start ボタンをクリックすると、jalview.jnlpがダウンロードされ、残りの必要なファイルも自動的にダウンロードされ、使用可能になる。 Citations Clamp, M., Cuff, J., Searle, S. M. and Barton, G. J. The Jalview Java Alignment Editor 2004. Bioinformatics, 20, 426-7
https://w.atwiki.jp/nicoapi/pages/39.html
[Web API, 非ログイン可] user/data ユーザーのデータを得る。 リクエスト URL GET http //seiga.nicovideo.jp/api/user/data?id={user_id} user_id ID データ形式 XML 形式。 データサンプル ?xml version="1.0" encoding="UTF-8"? response image_count 3 /image_count image_list image id 3937109 /id user_id 27849771 /user_id title カゼ /title description/ view_count 1399 /view_count comment_count 8 /comment_count clip_count 79 /clip_count summary かわいい・・・ 幼い肢体の太股… あらきれい いいわぁ・・・ 淡い塗りがいいですね やわらかい(確信) ぺろりてぇ・・・ ふぅ・・・ /summary genre 300 /genre category 1 /category image_type 1 /image_type illust_type 0 /illust_type inspection_status 1 /inspection_status anonymous_flag 0 /anonymous_flag public_status 0 /public_status delete_flag 0 /delete_flag delete_type 0 /delete_type cache_time/ created 2014-04-19 14 27 28 /created /image image id 3937107 /id user_id 27849771 /user_id title マリー /title description 5月4日カゲプロオンリーでの、まにおさんの個人イラスト本にゲスト寄稿したものの一部です。(一部と見せかけてほとんど見せている) /description view_count 107 /view_count comment_count 0 /comment_count clip_count 1 /clip_count summary/ genre 200 /genre category 1 /category image_type 1 /image_type illust_type 0 /illust_type inspection_status 1 /inspection_status anonymous_flag 0 /anonymous_flag public_status 0 /public_status delete_flag 0 /delete_flag delete_type 0 /delete_type cache_time/ created 2014-04-19 14 25 10 /created /image image id 3937098 /id user_id 27849771 /user_id title 咲 /title description おなにーするぞ /description view_count 253 /view_count comment_count 0 /comment_count clip_count 2 /clip_count summary/ genre -100 /genre category -1 /category image_type 1 /image_type illust_type 1 /illust_type inspection_status 1 /inspection_status anonymous_flag 0 /anonymous_flag public_status 0 /public_status delete_flag 0 /delete_flag delete_type 0 /delete_type cache_time/ created 2014-04-19 14 19 24 /created /image /image_list comment_list comment comment_id 18534505 /comment_id id 18534505 /id image_id 3937109 /image_id res_id 0 /res_id content ふぅ・・・ /content command/ created 2014-04-19 15 25 53 /created frame -1 /frame user_hash 3rP8+l9ny9Y/iKhs8r9vSn/+jQA /user_hash anonymous_flag 1 /anonymous_flag /comment comment comment_id 18534610 /comment_id id 18534610 /id image_id 3937109 /image_id res_id 0 /res_id content ぺろりてぇ・・・ /content command/ created 2014-04-19 15 33 18 /created frame -1 /frame user_hash RT4Uif3Ry5bDGAcRhin5orV/HHs /user_hash anonymous_flag 1 /anonymous_flag /comment comment comment_id 18535030 /comment_id id 18535030 /id image_id 3937109 /image_id res_id 0 /res_id content やわらかい(確信) /content command/ created 2014-04-19 16 27 01 /created frame -1 /frame user_hash 9qiGEltBimLXeoC3e34PbQAloDE /user_hash anonymous_flag 1 /anonymous_flag /comment comment comment_id 18535065 /comment_id id 18535065 /id image_id 3937109 /image_id res_id 0 /res_id content 淡い塗りがいいですねー /content command/ created 2014-04-19 16 32 25 /created frame -1 /frame user_hash yIPiLKswUDzzOrf9mPCNQpKvYNw /user_hash anonymous_flag 1 /anonymous_flag /comment comment comment_id 18535187 /comment_id id 18535187 /id image_id 3937109 /image_id res_id 0 /res_id content いいわぁ・・・ /content command/ created 2014-04-19 16 50 57 /created frame -1 /frame user_hash fzOgikO+edl+vnjOJHmKbO3B3MI /user_hash anonymous_flag 1 /anonymous_flag /comment comment comment_id 18535527 /comment_id id 18535527 /id image_id 3937109 /image_id res_id 0 /res_id content あらきれい /content command/ created 2014-04-19 17 31 56 /created frame -1 /frame user_hash 26751669 /user_hash anonymous_flag 0 /anonymous_flag /comment comment comment_id 18535595 /comment_id id 18535595 /id image_id 3937109 /image_id res_id 0 /res_id content 幼い肢体の太股… /content command/ created 2014-04-19 17 42 19 /created frame -1 /frame user_hash iRATiyaRxT904yOlMBjjXqLsBCQ /user_hash anonymous_flag 1 /anonymous_flag /comment comment comment_id 18536848 /comment_id id 18536848 /id image_id 3937109 /image_id res_id 0 /res_id content かわいい・・・ /content command/ created 2014-04-19 19 40 45 /created frame -1 /frame user_hash PeeZ+d6n55NtgkVX2Yc9fdmns04 /user_hash anonymous_flag 1 /anonymous_flag /comment /comment_list /response 更新履歴 2014/5/2 記述
https://w.atwiki.jp/lslwiki/pages/264.html
llRequestAgentData key llRequestAgentData(key id, integer data) 機能概略 サンプル Tips 詳細な説明 History 来客数: - 選択肢 投票 役に立った (0) 役立たずだった (0) 名前 コメント
https://w.atwiki.jp/m_shige1979/pages/975.html
mt_tag 機能 調査中 CreateTable CREATE TABLE `mt_tag` ( `tag_id` INT(11) NOT NULL AUTO_INCREMENT, `tag_is_private` TINYINT(4) NULL DEFAULT 0 , `tag_n8d_id` INT(11) NULL DEFAULT 0 , `tag_name` VARCHAR(255) NOT NULL, PRIMARY KEY (`tag_id`), INDEX `mt_tag_n8d_id` (`tag_n8d_id`), INDEX `mt_tag_name_id` (`tag_name`, `tag_id`), INDEX `mt_tag_name` (`tag_name`), INDEX `mt_tag_private_id_name` (`tag_is_private`, `tag_id`, `tag_name`) ) 一覧 調査中 関連テーブル 調査中